package com.firebugsoft.spring.cloud.ribbon.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/ribbon")
public class RibbonController {
    @Resource
    private RestTemplate restTemplate;

    @GetMapping(value = "/service/monitor/env")
    public String serviceMonitorEnv() {
        return restTemplate.getForEntity("http://spring-cloud-service/service/monitor/env", String.class).getBody();
    }
}
